<?php
if(isset($_SESSION['auth']['group'])) 
{
     $group = $_SESSION['auth']['group'];
}
else
{
     $group = 0;
};
$query=dibi::query("
SELECT `articles`.id,`articles`.name,`articles`.shortcontent,`articles`.content,
`articles`.author,`articles`.category,`articles`.publication_date,`rights`.right 
FROM `articles` INNER JOIN rights ON `articles`.`category` =  `rights`.`category` 
WHERE  `rights`.`group_id` =",$group,"AND  `rights`.`right` =1");
$num=count($cat_query);

if ($num) 
{
     foreach($query as $row)
     {
          echo '<table border="1">';
	         echo "<tr><td>ID</td><td>" . $row["id"] . "</td></tr>";
	         echo "<tr><td>NAME</td><td>" . $row["name"] . "</td></tr>";
	         echo "<tr><td>SHORTCONTENT</td><td>" . $row["shortcontent"] . "</td></tr>";
	         echo "<tr><td>CONTENT</td><td>" . $row["content"] . "</td></tr>";
	         echo "<tr><td>AUTHOR(id)</td><td>" . $row["author"] . "</td></tr>";
	         echo "<tr><td>CATEGORY(id)</td><td>" . $row["category"] . "</td></tr>";
	         echo "</table>";
     }       
};
?>
